package com.qinggeng.project.system.mapper;

import com.qinggeng.project.api.dto.UserSearchDto;
import com.qinggeng.project.system.domain.UserSearch;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserSearchMapper {

    int insertUserSearch(UserSearch userSearch);

    @Update("update user_search set show_flag=20 where user_id =#{userId}")
    int deleteUserSearchByUserId(Long userId);

    int updateUserSearch(UserSearch userSearch);

    List<UserSearch> selectUserSearchList(UserSearch userSearch);

    /**
     * 根据用户ID查询用户历史搜索记录
     * @param userId
     * @return
     */
    List<UserSearchDto> selectUserSearchListDtoByUserId(Long userId);

    /**
     * 根据用户搜索内容精确匹配
     * @param userId
     * @param content
     * @return
     */
    UserSearch selectUserSearchByContent(Long userId,String content);
}
